<!--

-->
<template>
	<view>
		<view class="biaoge_box">
			<u-table>
				<u-tr>
					<u-th>邀请人数</u-th>
					<u-th>首单</u-th>
					<u-th>第2单</u-th>
					<u-th>第3单</u-th>
					<u-th>后续每单</u-th>
				</u-tr>
				<u-tr>
					<!-- <view class="tag_box" v-if="makemoneydata.level == 1">
						<uni-tooltip :content="'当前等级'">V1</uni-tooltip>
					</view> -->
					<u-td style="font-size: 24rpx;">{{one.text}}</u-td>
					<u-td>{{one.first}}元</u-td>
					<u-td>{{one.second}}元</u-td>
					<u-td>{{one.three}}元</u-td>
					<u-td>{{one.four}}元</u-td>
				</u-tr>
				<u-tr>
					<!-- <view class="tag_box" v-if="makemoneydata.level == 2">
						<uni-tooltip :content="'当前等级'">V2</uni-tooltip>
					</view> -->
					<u-td style="font-size: 24rpx;">{{two.text}}</u-td>
					<u-td>{{two.first}}元</u-td>
					<u-td>{{two.second}}元</u-td>
					<u-td>{{two.three}}元</u-td>
					<u-td>{{two.four}}元</u-td>
				</u-tr>
				<u-tr>
					<!-- <view class="tag_box" v-if="makemoneydata.level == 3">
						<uni-tooltip :content="'当前等级'">V3</uni-tooltip>
					</view> -->
					<u-td style="font-size: 24rpx;">{{three.text}}</u-td>
					<u-td>{{three.first}}元</u-td>
					<u-td>{{three.second}}元</u-td>
					<u-td>{{three.three}}元</u-td>
					<u-td>{{three.four}}元</u-td>
				</u-tr>
				<!-- <u-tr>
					<view class="tag_box" v-if="makemoneydata.level == 4">
						<uni-tooltip :content="'当前等级'">V4</uni-tooltip>
					</view>
					<u-td style="font-size: 24rpx;">至尊会员</u-td>
					<u-td>{{four.first}}元</u-td>
					<u-td>{{four.second}}元</u-td>
					<u-td>{{four.three}}元</u-td>
					<u-td>{{four.four}}元</u-td>
				</u-tr> -->
				<!-- <u-tr>
					<view class="tag_box" v-if="makemoneydata.level == 5">
						<uni-tooltip :content=" '还差' + [six.num - makemoneydata.spread_people_num] + '人升至6级' ">V5</uni-tooltip>
					</view>
					<u-td>V5</u-td>
					<u-td>{{five.num}}人</u-td>
					<u-td>{{five.first}}元</u-td>
					<u-td>{{five.second}}元</u-td>
					<u-td>{{five.three}}元</u-td>
					<u-td>{{five.four}}元</u-td>
				</u-tr>
				<u-tr>
					<view class="tag_box" v-if="makemoneydata.level == 6">
						<uni-tooltip :content=" '还差' + [seven.num - makemoneydata.spread_people_num] + '人升至7级' ">V6</uni-tooltip>
					</view>
					<u-td>V6</u-td>
					<u-td>{{six.num}}人</u-td>
					<u-td>{{six.first}}元</u-td>
					<u-td>{{six.second}}元</u-td>
					<u-td>{{six.three}}元</u-td>
					<u-td>{{six.four}}元</u-td>
				</u-tr>
				<u-tr>
					<view class="tag_box" v-if="makemoneydata.level == 7">
						<uni-tooltip :content=" '恭喜你达到最顶级了' ">V7</uni-tooltip>
					</view>
					<u-td>V7</u-td>
					<u-td>{{seven.num}}人</u-td>
					<u-td>{{seven.first}}元</u-td>
					<u-td>{{seven.second}}元</u-td>
					<u-td>{{seven.three}}元</u-td>
					<u-td>{{seven.four}}元</u-td>
				</u-tr> -->
			</u-table>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		name: "invitationRules",
		data() {
			return {
				FenxiangShow: false,
				guizeInfo: "",
				BestImgUrl: app.globalData.imgurlBwc,
				one: {}, //等级1
				two: {}, //等级2
				three: {}, //等级3
				four: {}, //等级4
				five: {}, //等级5
				six: {}, //等级6
				seven: {}, //等级7
				
				makemoneydata: 1
			};
		},
		created() {
			this.getguize();
			this.getmakemoney();
			this.getMyCard();
		},
		methods: {
			getMyCard(){
				let that = this
				that.$api.GetMyVipCard({
				
				}).then(res => {
					console.log('我开通的会员卡', res.data.result)
					that.makemoneydata = res.data.result.vip_level
				}).catch(err => {})
			},
			//获取我的明细
			getmakemoney() {
				let that = this
				that.$api.Getmakemoney({
			
				}).then(res => {
					that.makemoneydata = res.data.result
				}).catch(err => {
					/*uni.showToast({
						title: err.data.msg,
						icon: 'none',
						duration: 2000
					});*/
				})
			},
			getguize() {
				let that = this
				that.$api.getInvitationRules({
					page: 1,
					city: uni.getStorageSync('CityName'),
				}).then(res => {
					console.log(res.data.result)
					that.guizeInfo = res.data.result
					this.one = res.data.result['1']
					this.two = res.data.result['2']
					this.three = res.data.result['3']
					this.four = res.data.result['4']
					this.five = res.data.result['5']
					this.six = res.data.result['6']
					this.seven = res.data.result['7']
				}).catch(err => {
					/*uni.showToast({
						title: err.data.msg,
						icon: 'none',
						duration: 2000
					});*/
				})
			},
			openFenx(e) {
				let that = this
				if (e == true) {
					that.FenxiangShow = false
				} else {
					that.FenxiangShow = true
				}
			},
			ToShareposters() {
				let that = this
				let token = uni.getStorageSync('token')
				if (!token) {
					
					uni.showModal({
						title: '提示',
						content: '您还未登陆,登录后可生成个人专属海报',
						confirmColor: '#FF4910',
						confirmText: '去登录',
						success: function (res) {
							if (res.confirm) {
								
								// #ifdef APP-PLUS
								//this.$PublicFunction.PhoneNumLogonTrue()
								uni.navigateTo({
									url: '/subpackageB/pages/newAppLogin/newAppLogin'
								})
								// #endif
												
								// #ifdef H5
								uni.switchTab({
									url: '/pages/me/me'
								})
								// #endif
								
								// #ifdef MP-WEIXIN
								uni.navigateTo({
									url: '/pages/logon/logon'
								})
								// #endif
								
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
					
				} else {
					uni.navigateTo({
						url: '/subpackageB/pages/Shareposters/Shareposters'
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">
	/deep/ .u-th {
		background-color: #FFDFD4 !important;
		font-size: 24rpx !important;
		padding: 20rpx 0 !important;
		color: #FF4910 !important;
	}

	/deep/ .u-tr {
		position: relative;
	}

	.tag_box {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: 62rpx;
		line-height: 62rpx;
		width: 400rpx;
		color: transparent;
		//background-color: #feaa72;
		border-radius: 200rpx;
		padding: 4rpx 10rpx;
	}

	.biaoge_box {
		padding: 30rpx;

		/deep/ .u-td {
			height: 31px;
		}
	}
</style>